﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdError_NotThatKindOfClass : OdError
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdError_NotThatKindOfClass(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdError_NotThatKindOfClass_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdError_NotThatKindOfClass obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdError_NotThatKindOfClass()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdError_NotThatKindOfClass(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdError_NotThatKindOfClass(OdRxClass fromClass, OdRxClass toClass) : this(GlobalsPINVOKE.new_OdError_NotThatKindOfClass__SWIG_0(OdRxClass.getCPtr(fromClass), OdRxClass.getCPtr(toClass)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdError_NotThatKindOfClass(OdError_NotThatKindOfClass arg0) : this(GlobalsPINVOKE.new_OdError_NotThatKindOfClass__SWIG_1(OdError_NotThatKindOfClass.getCPtr(arg0)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public string fromClassName()
		{
			string result = GlobalsPINVOKE.OdError_NotThatKindOfClass_fromClassName(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public string toClassName()
		{
			string result = GlobalsPINVOKE.OdError_NotThatKindOfClass_toClassName(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
